<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= webpackConfig.name %></title>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->


    <script>
    /** ***********************************
     * 日期类型格式化函数
     * 语法：
     *  var date = new Date();
     *      console.log(date.toDate());
     *      console.log(date.toTime());
     *      console.log(date.toDatetime());
     *      console.log(date.format('yyyy-MM-dd HH:mm'));
     *************************************/
    Date.prototype.format = function(format) {
      var o = {
        'M+': this.getMonth() + 1, // month
        'd+': this.getDate(), // day
        'H+': this.getHours(), // hour
        'm+': this.getMinutes(), // minute
        's+': this.getSeconds(), // second
        'q+': Math.floor((this.getMonth() + 3) / 3), // quarter
        'S': this.getMilliseconds() // millisecond
      }

      if (/(y+)/.test(format)) {
        format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
      }

      for (var k in o) {
        if (new RegExp('(' + k + ')').test(format)) {
          format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
        }
      }
      return format
    }
    Date.prototype.toDate = function() {
      return this.format('yyyy-MM-dd')
    }
    Date.prototype.toTime = function() {
      return this.format('HH:mm:ss')
    }
    Date.prototype.toDatetime = function() {
      return this.format('yyyy-MM-dd HH:mm:ss')
    }
    </script>
  </body>
</html>
